class Farming

Food resource representing farming. Farming is unique in that it is not a naturally repopulated resource.

Public Class Methods

new(cc, area) click to toggle source
Calls superclass method Cereal.new
# File lib/farming.rb, line 7
def initialize(cc, area)
  super(cc, area)
  # Calculate maximum obtainable cereal kilos from farming
  #       farming capacity     hectares     farmable land
  # Fixed size based on area and carrying capacity of cereal
  @capacity = @size = 0.25 * (1000 - cc) * area * 0.1
  @search_difficulty = 0 # you don't have to search for farms
  @repopulation_chance = 0 # does not naturally repopulate from depletion
  @tend_time = @handle_time # but, farms take time to tend to
  @name = :Farming
  @colour = [0.0, 0.0, 1.0] # B
end

Public Instance Methods

grow() click to toggle source

Farms have a fixed farmable area and harvest per km^2 So they simply reset to their initial capacity

# File lib/farming.rb, line 23
def grow
  @size = @capacity
end